<template>
	<view class="">
		<view class="header">
			<view class="basj">
				<image @click="gobacks" src="/static/dazi/bak.png" mode=""></image>
				<text class="title">写评价</text>
			</view>
		</view>
		<view class="conshe">
			<view class="cojslo">
				<view class="onks">
					总体评分
				</view>
				<view class="">
					<up-rate active-color="#FB75D6" v-model="allval" activeIcon="heart-fill"
						inactiveIcon="heart"></up-rate>
				</view>
			</view>
			<view class="cojslo">
				<view class="onks">
					服务评分
				</view>
				<view class="">
					<up-rate active-color="#FB75D6" v-model="serveval" activeIcon="heart-fill"
						inactiveIcon="heart"></up-rate>
				</view>
			</view>
			<view class="cojslo">
				<view class="onks">
					项目评分
				</view>
				<view class="">
					<up-rate active-color="#FB75D6" v-model="proval" activeIcon="heart-fill"
						inactiveIcon="heart"></up-rate>
				</view>
			</view>
			   <!-- Textarea 输入框 -->
			    <view class="textarea-wrapper">
			      <textarea
			        class="textarea"
			        placeholder="请输入内容"
			        :maxlength="maxLength"
			        @input="handleInput"
			        :style="{ height: '200px' }"
			      ></textarea>
			      <!-- 右下角字符计数 -->
			      <view class="counter">
			        <text>{{ currentLength }}/{{ maxLength }}</text>
			      </view>
			    </view>
				
				<view class="cijs">
					提交评价
				</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				allval: 1,
				serveval: 1,
				proval: 1,
				 maxLength: 300, // 最大字符数
				      currentLength: 0, // 当前字符数
			}
		},
		methods: {
			   // 监听输入事件
			    handleInput(event) {
			      this.currentLength = event.detail.value.length;
			    },
			
			gobacks() {

				// #ifdef H5
				history.back();
				// #endif

				// #ifdef APP
				uni.navigateBack()
				// #endif

			},
		}
	}
</script>

<style lang="scss">
	.cijs{
		position: fixed;
		bottom: 50rpx;
		left: 30rpx;
		right: 30rpx;
		color: #FFFFFF;
		font-size: 32rpx;
		font-weight: 700;
		background-color: #FB75D6;
		text-align: center;
		height: 110rpx;
		line-height: 110rpx;
		border-radius: 50rpx;
	}
	
	.textarea-wrapper {
		margin: 60rpx 0;
	  position: relative;
	  border: 1px solid #ccc;
	  border-radius: 8px;
	  padding: 10px;
	}
	
	.textarea {
	  width: 100%;
	  font-size: 14px;
	  line-height: 1.5;
	}
	
	.counter {
	  position: absolute;
	  right: 10px;
	  bottom: 10px;
	  font-size: 12px;
	  color: #999;
	  background-color: rgba(255, 255, 255, 0.8);
	  padding: 2px 6px;
	  border-radius: 4px;
	}
	
	
	.cojslo {
		margin-bottom: 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.onks {
		color: #2A222F;
		font-size: 32rpx;
	}

	.conshe {
		margin: 60rpx 0;
	}

	page {
		padding: 30rpx;
		background-color: #fff;

		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;
	}

	.basj {
		display: flex;
		align-items: center;
		height: 60rpx;

		image {
			width: 48rpx;
			height: 48rpx;
			vertical-align: middle;
		}

		.title {
			margin-left: 10rpx;
			color: #2A222F;
			font-size: 40rpx;
		}
	}

	.header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 60rpx;

		letter-spacing: 2rpx;
		/* 字母间距 */
		font-weight: 600;
		// border: #dddddd solid 1px;

		.btn-side {
			position: absolute;
			line-height: 60rpx;
			font-size: 28rpx;
			cursor: pointer;

			&.right {
				right: 30rpx;
			}
		}
	}
</style>